#include <iostream>
#include <vector>
#include <queue>

using namespace std;

class Node {
public:
    int val;
    vector<Node*> children;

    Node() {}

    Node(int _val) {
        val = _val;
    }

    Node(int _val, vector<Node*> _children) {
        val = _val;
        children = _children;
    }
};

vector<vector<int>> levelOrder(Node* root) {
    if (root == nullptr)
        return vector<vector<int>>();

    vector<vector<int>> ret;
    queue<Node*> que;

    que.push(root);

    while (que.size())
    {
        int sz = que.size();
        vector<int> tmp;

        for (int i = 0; i < sz; ++i)
        {
            Node* node = que.front();
            que.pop();
            tmp.push_back(node->val);

            for (auto child : node->children)
                if (child != nullptr)
                    que.push(child);
        }
        ret.push_back(tmp);
    }

    return ret;
}

int main()
{

	return 0;
}